<template>
<el-form :inline="true" :model="formData" class="search-top">
    <el-form-item>人员管理</el-form-item>
    <el-form-item label="用户名">
      <el-input v-model="formData.username" placeholder="用户名" clearable />
    </el-form-item>
      <el-form-item label="电话号码">
      <el-input v-model="formData.phonenumber" placeholder="电话号码" clearable />
    </el-form-item>
  
    <el-form-item>
      <el-button type="primary" @click="emits('search',{...formData})">搜索</el-button>
      <el-button type="warning" @click="emits('adduser')" class="add">添加人员</el-button>
    </el-form-item>
  </el-form>
</template>

<script lang='ts' setup>
import type { ISearchFormData } from '@/interfaces/IUser';
import { reactive } from 'vue';

const emits=defineEmits(['search',"adduser"])
const formData:ISearchFormData=reactive({
    username:'',
    phonenumber:'',
})
// const onSearchHandler=()=>{
//     console.log(formData)
// }
//  const onAdduserHandler=()=>{

//  }
</script>

<style lang='scss' scoped>
.search-top{
    margin-top: 10px;
}
.add{
    margin-left: 160px;
}

</style>